cmake_minimum_required(VERSION 3.5.1)

project(file-server VERSION 0.1)

set(CMAKE_C_FLAG "-w")

include(cmake/BuildSourceTgz.cmake)

add_subdirectory(lib/SocketUtils)
add_subdirectory(lib/FinalC)
function(add_socketutils_config _NAME)
    add_executable(${_NAME} ${ARGN})
    target_include_directories(${_NAME} PRIVATE
        ${SocketUtils_INCLUDE_DIRS}
        ${FinalC_INCLUDE_DIRS}
    )
    target_link_libraries(${_NAME}
        ${SocketUtils_LIBRARIES}
        ${FinalC_LIBRARIES}
    )
endfunction(add_socketutils_config _NAME)


add_socketutils_config(server server.c)
add_socketutils_config(client client.c)
add_socketutils_config(progress progress.c)


# add_executable(echo_server echo_server.c wrap.c)
# add_executable(echo_client echo_client.c wrap.c)


# if you want build this project
# please run: 
#   mkdir build && cd build && cmake .. && make